-- Decompiled with the Synapse X Luau decompiler.

local l__ClientOHOH__1 = _G.ClientOHOH;
local l__type__1 = type;
local l__pairs__2 = pairs;
local u3=nil
u3 = {
	GetInst = function(p1, p2)
		if l__type__1(p2) ~= "table" then
			if l__type__1(p2) == "string" then
				return p1:WaitForChild_Loop(p2);
			else
				return;
			end;
		end;
		local v2 = {};
		for v3, v4 in l__pairs__2(p2) do
			v2[v3] = u3.GetInst(p1, v4);
		end;
		return v2;
	end
};
local u4 = l__ClientOHOH__1.class.new(script, l__ClientOHOH__1.files.GameObject());
function u4.new(p3)
	return u4(p3);
end;
local u5 = l__ClientOHOH__1.load.CallBackManager();
function u4.ctor(p4, p5)
	u4.super.ctor(p4, p5);
	if p4.insts then
		p4.insts = u3.GetInst(p4, p4.insts);
	end;
	if p4.OnInputBegan then
		u5:AddRbxConnect(p4, p4.main_inst.InputBegan, p4.OnInputBegan);
	end;
	if p4.OnInputChanged then
		u5:AddRbxConnect(p4, p4.main_inst.InputChanged, p4.OnInputChanged);
	end;
	if p4.OnInputEnded then
		u5:AddRbxConnect(p4, p4.main_inst.InputEnded, p4.OnInputEnded);
	end;
	if p4.OnMouseEnter then
		u5:AddRbxConnect(p4, p4.main_inst.MouseEnter, p4.OnMouseEnter);
	end;
	if p4.OnMouseLeave then
		u5:AddRbxConnect(p4, p4.main_inst.MouseLeave, p4.OnMouseLeave);
	end;
	if p4.OnMouseMoved then
		u5:AddRbxConnect(p4, p4.main_inst.MouseMoved, p4.OnMouseMoved);
	end;
	if p4.OnMouseWheelBackward then
		u5:AddRbxConnect(p4, p4.main_inst.MouseWheelBackward, p4.OnMouseWheelBackward);
	end;
	if p4.OnMouseWheelForward then
		u5:AddRbxConnect(p4, p4.main_inst.MouseWheelForward, p4.OnMouseWheelForward);
	end;
	if p4.OnTouchLongPress then
		u5:AddRbxConnect(p4, p4.main_inst.TouchLongPress, p4.OnTouchLongPress);
	end;
	if p4.OnTouchPinch then
		u5:AddRbxConnect(p4, p4.main_inst.TouchPinch, p4.OnTouchPinch);
	end;
	if p4.OnTouchRotate then
		u5:AddRbxConnect(p4, p4.main_inst.TouchRotate, p4.OnTouchRotate);
	end;
	if p4.OnTouchSwipe then
		u5:AddRbxConnect(p4, p4.main_inst.TouchSwipe, p4.OnTouchSwipe);
	end;
	if p4.OnTouchTap then
		u5:AddRbxConnect(p4, p4.main_inst.TouchTap, p4.OnTouchTap);
	end;
end;
function u4.dtor(p6)
	p6.main_inst:Destroy();
	u4.super.dtor(p6);
end;
function u4.Show(p7)
	if p7.OnShow then
		p7:OnShow();
	end;
	p7.main_inst.Visible = true;
end;
function u4.Hide(p8)
	if p8.OnHide then
		p8:OnHide();
	end;
	p8.main_inst.Visible = false;
end;
local l__assert__6 = assert;
function u4.InitUIGridLay(p9, p10, p11)
	l__assert__6(p10, "param scorlling frame is nil");
	l__assert__6(p11, "param ui grid layout is nil");
	l__assert__6(p10:IsA("ScrollingFrame"), "param scorlling frame must be a ScorllingFrame");
	l__assert__6(p11:IsA("UIGridLayout"), "param ui grid layout must be a UIGridLayout");
	local l__CellSize__5 = p11.CellSize;
	local l__CellPadding__6 = p11.CellPadding;
	local l__CanvasSize__7 = p10.CanvasSize;
	u5:AddRbxConnect(p9, p11.Changed, function(p12, p13)
		if p13 == "AbsoluteCellCount" then
			local l__CanvasSize__7 = p10.CanvasSize;
			local l__AbsoluteCanvasSize__8 = p10.AbsoluteCanvasSize;
			local l__CellSize__9 = p11.CellSize;
			local l__CellPadding__10 = p11.CellPadding;
			local l__AbsoluteContentSize__11 = p11.AbsoluteContentSize;
			local v12 = l__AbsoluteContentSize__11.X / l__AbsoluteCanvasSize__8.X;
			local v13 = l__AbsoluteContentSize__11.Y / l__AbsoluteCanvasSize__8.Y;
			local v14 = l__CanvasSize__7.X.Scale * v12;
			local v15 = l__CanvasSize__7.Y.Scale * v13;
			if v14 <= l__CanvasSize__7.X.Scale and v15 <= l__CanvasSize__7.Y.Scale then
				return;
			end;
			p10.CanvasSize = UDim2.fromScale(v14, v15);
			p11.CellSize = UDim2.fromScale(l__CellSize__9.X.Scale / v12, l__CellSize__9.Y.Scale / v13);
			p11.CellPadding = UDim2.fromScale(l__CellPadding__10.X.Scale / v12, l__CellPadding__10.Y.Scale / v13);
		end;
	end);
end;
function u4.InitUIListLay(p14, p15, p16)
	l__assert__6(p15, "param scorlling frame is nil");
	l__assert__6(p16, "param ui grid layout is nil");
	l__assert__6(p15:IsA("ScrollingFrame"), "param scorlling frame must be a ScorllingFrame");
	l__assert__6(p16:IsA("UIGridLayout"), "param ui grid layout must be a UIGridLayout");
	local l__CellSize__16 = p16.CellSize;
	local l__CellPadding__17 = p16.CellPadding;
	local l__CanvasSize__8 = p15.CanvasSize;
	u5:AddRbxConnect(p14, p16.Changed, function(p17, p18)
		if p18 == "AbsoluteCellCount" then
			local l__CanvasSize__18 = p15.CanvasSize;
			local l__CellSize__19 = p16.CellSize;
			local l__CellPadding__20 = p16.CellPadding;
			local v21 = p16.AbsoluteContentSize.Y / p15.AbsoluteCanvasSize.Y;
			local v22 = l__CanvasSize__18.Y.Scale * v21;
			if v22 <= l__CanvasSize__8.Y.Scale then
				return;
			end;
			p15.CanvasSize = UDim2.fromScale(l__CanvasSize__18.X.Scale, v22);
			p16.CellSize = UDim2.fromScale(l__CellSize__19.X.Scale, l__CellSize__19.Y.Scale / v21);
			p16.CellPadding = UDim2.fromScale(l__CellPadding__20.X.Scale, l__CellPadding__20.Y.Scale / v21);
		end;
	end);
end;
return u4;
